package com.ytjj.common.condition;

import org.springframework.boot.autoconfigure.condition.ConditionOutcome;
import org.springframework.boot.autoconfigure.condition.SpringBootCondition;
import org.springframework.context.annotation.ConditionContext;
import org.springframework.core.type.AnnotatedTypeMetadata;


/**
 * 微信配置条件装配
 *
 *
 * @version 1.0
 * 
 */
public class WxCondition extends SpringBootCondition {

    @Override
    public ConditionOutcome getMatchOutcome(ConditionContext context, AnnotatedTypeMetadata metadata) {
        String str = context.getEnvironment().getProperty("quanmingyanxuan.wx.CERT_PATH");
        if(null == str || str  == ""){
            return new ConditionOutcome(false, "error");
        }
        return new ConditionOutcome(true, "ok");
    }
}
